/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hdasnvicpaul.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author WILLIAN
 */
@Embeddable
public class AncianoPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "INSTITUCION", nullable = false)
    private long institucion;
    @Basic(optional = false)
    @Column(name = "SUCURSAL", nullable = false)
    private long sucursal;
    @Basic(optional = false)
    @Column(name = "CODIGO", nullable = false)
    private long codigo;

    public AncianoPK() {
    }

    public AncianoPK(long institucion, long sucursal, long codigo) {
        this.institucion = institucion;
        this.sucursal = sucursal;
        this.codigo = codigo;
    }

    public long getInstitucion() {
        return institucion;
    }

    public void setInstitucion(long institucion) {
        this.institucion = institucion;
    }

    public long getSucursal() {
        return sucursal;
    }

    public void setSucursal(long sucursal) {
        this.sucursal = sucursal;
    }

    public long getCodigo() {
        return codigo;
    }

    public void setCodigo(long codigo) {
        this.codigo = codigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) institucion;
        hash += (int) sucursal;
        hash += (int) codigo;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AncianoPK)) {
            return false;
        }
        AncianoPK other = (AncianoPK) object;
        if (this.institucion != other.institucion) {
            return false;
        }
        if (this.sucursal != other.sucursal) {
            return false;
        }
        if (this.codigo != other.codigo) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hdasnvicpaul.entidad.AncianoPK[institucion=" + institucion + ", sucursal=" + sucursal + ", codigo=" + codigo + "]";
    }

}
